<%@page import="helpers.BBCodeHelper"%>
<%@page import="helpers.LanguageHelper"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="helpers.StringHelper"%>
<%@page import="entities.User"%>
<%@page import="java.util.TreeMap"%>
<%@page import="entities.Article"%>
<%@page import="entities.Category"%>
<%@page import="java.util.List"%>
<%
Article article = (Article) request.getAttribute("article");
Category category = (Category) request.getAttribute("category");
User user = (User) request.getAttribute("user_logged_in");
String url = (String) request.getAttribute("url");
LanguageHelper translate = (LanguageHelper) request.getAttribute("translate");


%>

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/user/layouts/header.jsp" />

<script src="/sources/ckeditor/ckeditor.js"></script>
<script src="/sources/ckeditor/adapters/jquery.js"></script>

<script type="text/javascript">
jQuery(document).ready(function () {
	
	jQuery(".ckeditor" ).ckeditor({
		extraPlugins : 'bbcode'
	});
	
});
</script>
                    <!-- change profile
					================================================== -->
                    <div class="tab-pane active" id="articles-form">
                    	<!-- form submit article
                        ================================================== -->          
                        <form method="post" action="" class="form-horizontal form-actions">
                            
                            <!-- article title & category
                            ================================================== -->
                            <div class="row-fluid control-group">
                                <div class="span6 control-group">
                                    <label><i class="icon-pencil"></i> Article Title  (required)</label>
                                    <%=article.getTitle() %>
                                </div>
                                <div class="span4 control-group">
                                    <label><i class="icon-folder-open"></i> Category</label>
                                    <%=category.getName() %>
                                </div>
                            </div>
                            
                            <!-- article's content
                            ================================================== -->
                            <div class="control-group">
                                <label><i class="icon-retweet"></i> Content (required)</label>
                                <%=BBCodeHelper.toHtml(article.getContent()) %>
                            </div>
                            
                            <!-- article's keyword
                            ================================================== -->
                            <div class="control-group">
                                <label><i class="icon-tags"></i> Keyword</label>
                                <%=StringHelper.listToString(article.getKeywords(), ", ")%>
                            </div>
                            
                        </form>
                    </div>
                    
                    
<jsp:include page="/user/layouts/footer.jsp" />